package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.data.AdminStatData;
import com.cskaoyan.service.AdminStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: yudefu
 * @date 2021年06月06日  18:02
 * @description: 统计报表模块
 */

@RestController
@RequestMapping("admin/stat")
public class AdminStatController {

    @Autowired
    AdminStatService adminStatService;

    //用户统计
    @RequestMapping("user")
    public BaseRespVo getUserStat() {

        AdminStatData adminStatData = adminStatService.getUserStat();

        return BaseRespVo.ok(adminStatData);
    }


    //订单统计
    @RequestMapping("order")
    public BaseRespVo getOrderStat() {

        AdminStatData adminStatData = adminStatService.getOrderStat();

        return BaseRespVo.ok(adminStatData);
    }


    //商品统计
    @RequestMapping("goods")
    public BaseRespVo getGoodsStat() {

        AdminStatData adminStatData = adminStatService.getGoodsStat();

        return BaseRespVo.ok(adminStatData);
    }
}
